#include "hf_currentconditionsdisplay.h"

HeadFirstS::HF_CurrentConditionsDisplay::HF_CurrentConditionsDisplay(HeadFirstS::HF_Subject *pWeatherData)
{
    this->m_pWeaterData = pWeatherData;
    this->m_pWeaterData->registerObserver(this);
}

void HeadFirstS::HF_CurrentConditionsDisplay::update(float temperature, float humidity, float pressure)
{
    this->m_temperature = temperature;
    this->m_humidity    = humidity   ;

    display();
}

void HeadFirstS::HF_CurrentConditionsDisplay::display()
{
    cout << "Current condition: "
         << m_temperature
         << "F degrees and "
         << m_humidity
         << endl;
}
